三维点云可视化
pcl
matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
points = np.loadtxt('0000000000.txt')
skip = 20 # Skip every n points
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
point_range = range(0, points.shape[0], skip) # skip points to prevent crash
ax.scatter(points[point_range, 0], # x
points[point_range, 1], # y
points[point_range, 2], # z
c=points[point_range, 2], # height data for color
cmap='spectral',
marker="x")
ax.axis('scaled') # {equal, scaled}
plt.show()
mayavi
import numpy as np
def viz_mayavi(points, vals="distance"):
x = points[:, 0] # x position of point
y = points[:, 1] # y